package com.cloudbroker.bcs.common.entity;

import java.io.Serializable;

import javax.persistence.Table;

import com.cloudbroker.bcs.common.dao.base.MyBatisPojo;
import com.cloudbroker.bcs.common.util.StringUtil;

public class HSBCSEntityBase extends MyBatisPojo implements HSBCSEntity, Serializable {
    
    /**
     * serialVersionUID
     */
    private static final long serialVersionUID = 1L;
    
    public String tableName() {
        Class<?> clazz = this.getClass();
        Table tableAnn = clazz.getAnnotation(Table.class);
        if (null != tableAnn) {
            return tableAnn.name();
        } else {
            return StringUtil.camelToUnderlineCase(clazz.getSimpleName());
        }
    }
    
}
